package com.ytktt.study.week8.task2.service;

import com.ytktt.study.week8.task2.entity.OrderInfoEntity;

import java.util.List;

/**
 * 订单业务逻辑抽象
 *
 * @author ytk
 */
public interface OrderService {

    /**
     * 单个保存
     *
     * @param entity the entity
     * @return the boolean
     */
    boolean save(OrderInfoEntity entity);

    /**
     * 批量保存
     *
     * @param list the list
     * @return the boolean
     */
    boolean batchSave(List<OrderInfoEntity> list);

    /**
     * 根据id更新
     *
     * @param entity the entity
     * @return the boolean
     */
    boolean updateById(OrderInfoEntity entity);

    /**
     * 根据id删除
     *
     * @param id the id
     * @return the boolean
     */
    boolean removeById(Long id);

    /**
     * 删除全部
     *
     * @return the boolean
     */
    boolean removeAll();

    /**
     * 查询全部
     *
     * @return the list
     */
    List<OrderInfoEntity> list();

    /**
     * 根据用户id查询
     *
     * @param userId the user id
     * @return the list
     */
    List<OrderInfoEntity> listByUserId(Integer userId);
}
